/******************* 公共变量 *******************/
var userId = core.getUrlData('user_id');

/******************* Vue初始化代码 *******************/
var vm = new Vue({
	el: '.wrap',
	data: {
		money: '',
		pwd: '',
		maxmoney: '',
		user_password: userPasswordUrl + '?user_id=' + userId,
		user_record: userRecordUrl + '?user_id=' + userId,
		user_hongbao: userHongbaoUrl + '?user_id=' + userId,
		user_withdraw: userWithdrawUrl + '?user_id=' + userId,
		invite_cash: inviteCashUrl + '?res_id=0',
		is_frize: '',
		widthdrawUrl: ''
	},
	methods: {
		href: function () {
			if (this.is_frize == 1) {
				core.href(this.invite_cash);
			} else {
				core.layerHint('您没有诚意金需要支付');
			}
		}
	},
	computed: {
		widthdrawUrl: function () {
			return this.user_withdraw + '&balance=' + Number(this.money) + '&maxmoney=' + this.maxmoney;
			// return ((this.pwd == '101') ? this.user_password : (this.user_withdraw + '&balance=' + Number(this.money) + '&maxmoney=' + this.maxmoney));
		}
	},
	components: {
		
	},
	created: function () {
		$.ajax({
			url: userWalletUrl,
			type: 'post',
			data: {user_id: userId},
			success: function (data) {
				console.log(data)

				$.extend(vm, data);
			}
		})
	},
	mounted: function () {
		common.bindBack();
	},
	updated: function () {
		
	}
});